#ifndef OUTPUTREADER_H
#define OUTPUTREADER_H

#include <QObject>
#include <QProcess>

class OutputReader : public QObject
{
    Q_OBJECT

public:
    explicit OutputReader(QProcess *process, QObject *parent = nullptr);
    ~OutputReader();

public slots:
    void readOutput();
    void stopReading(); // 停止读取
    void startReading(); // 启动读取

signals:
    void outputReceived(const QByteArray &output);

private:
    QProcess *process;
    bool running; // 控制循环的标志
};

#endif // OUTPUTREADER_H
